package com.chenfan.mcn.clients;

import com.dingtalk.api.request.OapiRobotSendRequest;
import com.dingtalk.api.response.OapiRobotSendResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 钉钉微告警
 * @author wulg
 * @date 2023/8/31
 */
@FeignClient(value = "dingtalk-alarm", url = "${alarm.dingtalk.host:https://oapi.dingtalk.com}")
public interface DingTalkAlarmClient {

    @PostMapping("/robot/send")
    OapiRobotSendResponse robotSend(@RequestParam("access_token") String access_token,
                                    @RequestParam("timestamp") long timestamp,
                                    @RequestParam("sign") String sign,
                                    @RequestBody OapiRobotSendRequest request);
}
